package com.common.www.service;

import java.io.IOException;

public class JavaDocToHTMLConverter {

    public static void main(String[] args) {
        String sourcePath = "F:\\tranData\\doc\\test.docx";
        String outputDirectory = "F:\\tranData\\doc";

        try {
            String command = "javadoc -d " + outputDirectory + " " + sourcePath;
            Process process = Runtime.getRuntime().exec(command);
            int exitCode = process.waitFor();

            if (exitCode == 0) {
                System.out.println("JavaDoc文档已成功生成到目录: " + outputDirectory);
            } else {
                System.out.println("生成JavaDoc文档失败");
            }
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
    }
}